package cn.itcast.bigdata.distributeLock;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 生成订单号规则
 * @author Administrator
 *
 */
public class OrderNumGenerator {
	
	private static int count =0;
	
	//生成订单号规则方法
	public String orderNumber(){
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
		
		return format.format(new Date())+"-"+ ++count;
	}

}
